/*******************************************************************************
 * Package: com.song.kkxxpoi.service
 * Type:    ArthasService
 * Date:    2025/5/23 14:09
 *
 * Copyright (c) 2025 LTD All Rights Reserved.
 *
 * You may not use this file except in compliance with the License.
 *******************************************************************************/
package com.song.kkxxpoi.service;

import lombok.SneakyThrows;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.concurrent.TimeUnit;

/**
 * 功能描述：
 *
 * @author Songxianyang
 * @date 2025/5/23 14:09
 */
@Service
public class ArthasService {
    @SneakyThrows
    public void m1() {
        TimeUnit.SECONDS.sleep(1);
        System.out.println("m1");
    }

    // m2->m3
    @SneakyThrows
    public void m2() {
        m3();
        TimeUnit.SECONDS.sleep(3);
        System.out.println("m2");
    }

    private void m3() {
        System.out.println("->");
        System.out.println("m3");
    }


    public void t1() {
        Thread thread = new Thread(()->{
            while (true) {
                System.out.println(new Date());
            }
        },"sxy-01");
        thread.start();
    }
}
